FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app

# 复制项目文件
COPY core .
COPY example/InvokeWorkflowExample.cs ./example/
COPY example/InvokeWorkflowRequest.cs ./example/
COPY *.sln .
COPY *.csproj .

# 恢复依赖项并构建项目
RUN dotnet restore
RUN dotnet publish -c Release -o out

# 构建运行时镜像
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build /app/out .
ENTRYPOINT ["dotnet", "ctyun-cf-sdk.dll"]